package com.xqboss.apps.enums.consumer;

import com.xqboss.common.enums.BaseEnum;

/**
 * @author Administrator
 * @date 2023/8/17
 */
public enum ConsumerTeamMemberTypeEnum implements BaseEnum<Integer> {

    TYPE_MAIN(1, "主成员"),
    TYPE_FATHER(2, "爸爸"),
    TYPE_MOM(3, "妈妈"),
    TYPE_SPOUSE(4, "配偶");

    private final Integer value;
    private final String msg;

    ConsumerTeamMemberTypeEnum(Integer value, String desc) {
        this.value = value;
        this.msg = desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getMsg() {
        return msg;
    }


    /**
     * 根据主成员的性别获取配偶的名称，默认 配偶为 妻子
     *
     * @param reminderSex  0=男,1=女,2=未知
     * @param type type
     * @return String
     */
    public static String getRelativeName(Integer reminderSex, ConsumerTeamMemberTypeEnum type) {
        String relativeName = "妻子";
        if(reminderSex ==0 && type.equals(ConsumerTeamMemberTypeEnum.TYPE_SPOUSE)){
            relativeName = "妻子";
        }
        else if(reminderSex ==1 && type.equals(ConsumerTeamMemberTypeEnum.TYPE_SPOUSE)){
            relativeName = "丈夫";
        }
        else if(!type.equals(ConsumerTeamMemberTypeEnum.TYPE_SPOUSE)){
            relativeName = type.getMsg();
        }
        return relativeName;
    }
}
